package controller;

import model.Perspective;
import model.RawImage;
import junit.framework.TestCase;

public class ZoomCommandTest extends TestCase {

	private String imgPath;
	private Perspective p;
	private ZoomCommand zc;
	private float origZoom;
	private float newZoom;
	
	public void setUp(){
		imgPath = "resources/CIMG2530.JPG";
		p = new Perspective(new RawImage(imgPath));
		origZoom = p.getZoom();
		newZoom = 5.0f;
		zc = new ZoomCommand(p, 5.0f);
	}
	
	public void testZoomCommand() {
		assertTrue(zc != null);
	}

	public void testExecute() {
		zc.execute();
		
		assertEquals(newZoom, p.getZoom());
	}

	public void testUndo() {
		zc.undo();
		
		assertEquals(origZoom, p.getZoom());
	}

}
